import 'package:gold/generated/json/base/json_convert_content.dart';
import 'package:gold/model/gold_recover_result_model.dart';

GoldRecoverResultModel $GoldRecoverResultModelFromJson(Map<String, dynamic> json) {
  final GoldRecoverResultModel goldRecoverResultModel = GoldRecoverResultModel();
  final String? method = jsonConvert.convert<String>(json['method']);
  if (method != null) {
    goldRecoverResultModel.method = method;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    goldRecoverResultModel.type = type;
  }
  final int? weight = jsonConvert.convert<int>(json['weight']);
  if (weight != null) {
    goldRecoverResultModel.weight = weight;
  }
  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    goldRecoverResultModel.price = price;
  }
  final int? shopId = jsonConvert.convert<int>(json['shop_id']);
  if (shopId != null) {
    goldRecoverResultModel.shopId = shopId;
  }
  final String? arriveTime = jsonConvert.convert<String>(json['arrive_time']);
  if (arriveTime != null) {
    goldRecoverResultModel.arriveTime = arriveTime;
  }
  final int? userId = jsonConvert.convert<int>(json['user_id']);
  if (userId != null) {
    goldRecoverResultModel.userId = userId;
  }
  final double? totalPrice = jsonConvert.convert<double>(json['total_price']);
  if (totalPrice != null) {
    goldRecoverResultModel.totalPrice = totalPrice;
  }
  final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
  if (updatedAt != null) {
    goldRecoverResultModel.updatedAt = updatedAt;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    goldRecoverResultModel.createdAt = createdAt;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    goldRecoverResultModel.id = id;
  }
  return goldRecoverResultModel;
}

Map<String, dynamic> $GoldRecoverResultModelToJson(GoldRecoverResultModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['method'] = entity.method;
  data['type'] = entity.type;
  data['weight'] = entity.weight;
  data['price'] = entity.price;
  data['shop_id'] = entity.shopId;
  data['arrive_time'] = entity.arriveTime;
  data['user_id'] = entity.userId;
  data['total_price'] = entity.totalPrice;
  data['updated_at'] = entity.updatedAt;
  data['created_at'] = entity.createdAt;
  data['id'] = entity.id;
  return data;
}

extension GoldRecoverResultModelExtension on GoldRecoverResultModel {
  GoldRecoverResultModel copyWith({
    String? method,
    int? type,
    int? weight,
    double? price,
    int? shopId,
    String? arriveTime,
    int? userId,
    double? totalPrice,
    String? updatedAt,
    String? createdAt,
    int? id,
  }) {
    return GoldRecoverResultModel()
      ..method = method ?? this.method
      ..type = type ?? this.type
      ..weight = weight ?? this.weight
      ..price = price ?? this.price
      ..shopId = shopId ?? this.shopId
      ..arriveTime = arriveTime ?? this.arriveTime
      ..userId = userId ?? this.userId
      ..totalPrice = totalPrice ?? this.totalPrice
      ..updatedAt = updatedAt ?? this.updatedAt
      ..createdAt = createdAt ?? this.createdAt
      ..id = id ?? this.id;
  }
}